const router = require('express').Router()
const U = require('../utils')

function abort_not_logined(req,res,next){
  if(req.session.name == null){
    console.log('您没有权限')
    res.json(U.err('请先登录'))
    return
  }
  next()
}

router.use('/login',require('./login'))
router.use('/nodes',abort_not_logined,require('./nodes'))
router.use('/node',abort_not_logined,require('./node'))
router.use('/article',abort_not_logined,require('./article'))

module.exports = router